package com.isesol.ime.manager;

import com.isesol.ime.dao.*;
import com.isesol.ime.entity.*;
import com.isesol.orm.jpa.*;
import org.springframework.stereotype.*;
import org.springframework.transaction.annotation.*;

import javax.annotation.*;
import java.util.*;

/**
 * 报文订阅管理 Manager
 *
 * @author Wang Jun
 */
@Component
@Transactional
public class SubscriptionManager extends AbstractJpaEntityManager<Subscription, Long>{

	/**
	 * 报文订阅 DAO
	 */
	@Resource
	SubscriptionDao subscriptionDao;

	public List<Subscription> findByMsgIdAndUsingStatus(long msgId,String usingStatus){

 		return subscriptionDao.findByMessageIdAndUsingStatus(msgId,usingStatus);

	}
	public List<Subscription> findByMachineIdAndStatus(String machineId,String status){

		return subscriptionDao.findByMachineIdAndStatus(machineId,status);

	}


	@Override
	@Resource(type = SubscriptionDao.class)
	protected void setDao(JpaDao dao){

		super.dao = dao;
	}

}
